package com.ddwl.common.feign.api;

import com.ddwl.common.annotation.Auth;
import com.ddwl.common.constant.BaseEnum;
import com.ddwl.schema.bo.base.PageBo;
import com.ddwl.schema.bo.order.BargainActivityOrderBo;
import com.ddwl.schema.bo.order.QuerySeckillBo;
import com.ddwl.schema.vo.base.PageVo;
import com.ddwl.schema.vo.base.RestVo;
import com.ddwl.schema.vo.order.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 订单API
 * @author 27670
 * @Date :2020-07-22 13:24.
 */
@FeignClient(name = "ddwl-order" ,path = "/order")
public interface OrderApi {

    /**
     * 获取订单详情
     * @param orderId
     * @return
     */
    @GetMapping("/api/{orderId}")
    RestVo<OrderInfoVo> getOrderInfo(@PathVariable String orderId);
    /**
     * 获取秒杀商品详情
     * @param bo
     * @return
     */
    @PostMapping("/secKill/querySeckillItemDetail")
    RestVo<List<SeckillItemVo>>querySeckillItemDetail(@RequestBody QuerySeckillBo bo);

    /**
     * 获取秒杀活动详情
     * @param pageBo
     * @return
     */
    @PostMapping("/secKill/querySeckill")
    RestVo<PageVo<SeckillVo>> querySeckill(@RequestBody PageBo<QuerySeckillBo> pageBo);

    /**
     * 查询秒杀商品列表
     */
    @PostMapping("/secKill/querySeckillItemList")
    RestVo<List<SeckillItemVo>> querySeckillItemList(@RequestBody QuerySeckillBo bo);

    /**
     * 查询秒杀订单详情
     */
    @PostMapping("/secKill/getSeckillOrder")
    RestVo<SecondKillOrderVo> getSeckillOrder(@RequestParam("id")  String id );

    /**
     * 砍价订单创建
     * @param bo
     * @return
     */
    @PostMapping("/user/bargainOrder/create")
    RestVo<String> createBargainOrder(@RequestBody BargainActivityOrderBo bo);

    /**
     * 查询保修期限
     * @return
     */
    @GetMapping("/user/orderInfo/getRepairTime")
    RestVo<Integer> getRepairTime();


    /**
     * 店铺首页数据统计
     * @return
     */
    @GetMapping("/shopData/{shopId}")
    @ApiOperation("店铺首页数据统计")
    RestVo<ShopOrderDataVo> getShopData(@PathVariable("shopId") String shopId);
}
